
***********************************************************************************************************************
**** Table A16. Heterogeneous Treatment Effects w.r.t. to Language ****************************************************
***********************************************************************************************************************

use "$data/Non_payment_dataset_ready.dta" , clear

log using "$filepath/output_logs/table A16", replace

local controls "itt2 itt2xeng itt3 itt3xeng eng premeaninvoicew presumpaymentratiow preage_of_accountw preclosingbalancew prepaidcounttotal interviewerdummy* datedummy* schemedummynew*"

* Extensive Margin *
probit paidcount `controls' if t==14, rob
margins, dydx(itt2 itt2xeng itt3 itt3xeng eng) post

*Intensive Margin*
reg lnpayment `controls' if t==14, rob

*TWO PM*
preserve 
keep if t==14
drop if lang=="." 
capture program drop Ey_boot
program define Ey_boot, eclass
twopm payment itt2 itt2xeng itt3 itt3xeng eng premeaninvoicew presumpaymentratiow preage_of_accountw preclosingbalancew prepaidcounttotal interviewerdummy* datedummy* schemedummynew* , firstpart(probit) secondpart(regress, log) vce(cluster customer)
margins, dydx(itt2 itt2xeng itt3 itt3xeng eng) predict(duan) nose post
end
bootstrap _b, seed(3125) reps(1000): Ey_boot
estimates store W 
restore

log close
